package wusiyuan.dao.impl;

import java.sql.SQLException;

import org.apache.commons.dbutils.QueryRunner;

import util.C3P0Util;
import wusiyuan.dao.UpdateThePasswordDao;

public class UpdateThePasswordDaoImpl implements UpdateThePasswordDao {

	@Override
	public Integer updateThePassword(String password,String username) {
		QueryRunner qr = new QueryRunner(C3P0Util.getDataSource());	
		String sql = "UPDATE user_login SET password  = ?   WHERE  username = ?";
		Object[] param= {password,username};
		Integer i=0;
		try {
			i=qr.update(sql, param);
		} catch (SQLException e) {
			e.printStackTrace();
		}
		return i;
	}

}
